import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)


const Home = ()=> import('./views/Home.vue')   //使用常量模式 提前声明 并且在component中使用 这样我们就完成了一个可以简单实用的路由了
const Login = ()=> import('./views/Login.vue') //登录
const My = ()=> import('./views/My.vue') //我的 
const Movie = ()=> import('./views/Movie.vue') //电影院
const Movie_detail = ()=> import('./views/Movie_detail.vue') //电影详情
const Music = ()=> import('./views/Music.vue') //music首页
const PlayMusic = ()=> import('./views/PlayMusic.vue') //歌单列表
const Comment = ()=> import('./views/Comment.vue') //评论
const UserDetail = ()=> import('./views/UserDetail.vue')//用户详情
const Search = ()=> import('./views/Search.vue')//搜索页
export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home
      //路由懒加载，推荐使用这种模式，
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/my',
      name: 'My',
      component: My
    },
    {
      path: '/movie',
      name: 'Movie',
      component: Movie
    },
    {
      path: '/movie_detail',
      name: 'Movie_detail',
      component: Movie_detail
    },
    {
      path: '/music',
      name: 'Music',
      component: Music
    },
    {
      path: '/playMusic',
      name: 'PlayMusic',
      component: PlayMusic
    },
    {
      path: '/comment',
      name: 'Comment',
      component: Comment
    },
    {
      path: '/userDetail',
      name: 'UserDetail',
      component: UserDetail
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
  ]
})
